package com.ymk.cmd;

import com.ymk.base.cmd.ACmd;
import com.ymk.base.cmd.CmdSign;
import com.ymk.bo.work.WorkToTypeBO;
import com.ymk.core.code.cmd.WorkToTypeCmdCode;
import com.ymk.service.IWorkToTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;

@Service
public class WorkToTypePatchCmd extends ACmd {

    @Override
    public CmdSign executeMop(HttpServletRequest request, CmdSign sign) throws Exception {
        CmdSign respSign = new CmdSign(sign);
        WorkToTypeBO reqData = super.getData(sign, WorkToTypeBO.class);

        this.workToTypeService.update(reqData);

        return respSign;
    }

    @Override
    public String getCmdCode() {
        return WorkToTypeCmdCode.WORK_TO_TYPE_PATCH;
    }

    @Override
    public boolean anon(CmdSign sign) {
        return true;
    }
    @Autowired
    private IWorkToTypeService workToTypeService;
}